package com.ciwong.epaper.modules.me.bean;

import com.ciwong.mobilelib.bean.BaseBean;
import com.google.gson.Gson;

/**
 * 服务详细信息
 *
 * @author bin
 * @version ciwong v.1.0 2015/8/5 15:48
 * @since ciwong v.1.0
 */
public class ServiceDetail extends BaseBean {

    private static final long serialVersionUID = -3315825044106061376L;
    /**
     * 服务ID
     */
    private long UserServiceId;

    /**
     * 服务版本（1：个人版，2班级版，3校园版）
     */
    private int VersionType;

    /**
     * 服务版本名称
     */
    private String VsersionTypeName;

    /**
     * 服务类型（服务ID）
     */
    private int ServiceType;

    /**
     * 服务类型名称
     */
    private String ServiceTypeName;

    /**
     * 服务状态（是否过期）
     */
    private boolean bExpired;

    /**
     * 剩余年份
     */
    private double ExpiredYear;

    /**
     * 服务状态说明
     */
    private String ExpiredStatus;

    /**
     * 用户ID
     */
    private long UseId;

    /**
     * 用户名称
     */
    private String UseName;

    /**
     * 服务URL
     */
    private String HomeUrl;

    /**
     * 价格
     */
    private int Price;

    /**
     * 服务结束时间
     */
    private String ExpireTime;

    /**
     * 是否购买
     */
    private boolean IsBuy;
    /**
     * 购买模式 1买断 0按月购买  3免费购买
     */
    private int sign = -1;

    /**
     * 剩余使用时间
     */
    private int SurplusData;

    /**
     * 试用次数
     */
    private int OntrialCount;

    /**
     * 服务是否下架（0：下架；1：正常使用）
     */
    private int IsShow;

    /**
     * 服务logo
     */
    private String logoUrl;

    /**
     * 是否是VIP 是VIP表示购买
     */
    private boolean IsVip;

    /**
     * 是否被删除了
     */
    private boolean isDeleted;

    /**
     * 适用区域
     */
    private String area;

    /**
     * 适用年段
     */
    private String period;

    /**
     * 未选中状态（false为选中状态，true为未选中状态）
     */
    private boolean unSelected;
    //是否是赠送 0非赠送  1 赠送
    private int IsFree = -1;

    //    0服务，1书
    private int salesType;

    private String message;

    public void setSalesType(int salesType) {
        this.salesType = salesType;
    }

    public int getSalesType() {
        return salesType;
    }

    public int getIsFree() {
        return IsFree;
    }

    public void setIsFree(int isFree) {
        IsFree = isFree;
    }

    public boolean isUnSelected() {
        return unSelected;
    }

    public void setUnSelected(boolean unSelected) {
        this.unSelected = unSelected;
    }

    public int getSign() {
        return sign;
    }

    public void setSign(int sign) {
        this.sign = sign;
    }

    public boolean isSelect() {
        return unSelected;
    }

    public void setSelect(boolean select) {
        unSelected = select;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }

    public void setBuy(boolean buy) {
        IsBuy = buy;
    }

    public boolean isDeleted() {
        return isDeleted;
    }

    public void setDeleted(boolean deleted) {
        isDeleted = deleted;
    }

    public long getUserServiceId() {
        return UserServiceId;
    }

    public void setUserServiceId(long userServiceId) {
        UserServiceId = userServiceId;
    }

    public int getVersionType() {
        return VersionType;
    }

    public void setVersionType(int versionType) {
        VersionType = versionType;
    }

    public String getVsersionTypeName() {
        return VsersionTypeName;
    }

    public void setVsersionTypeName(String vsersionTypeName) {
        VsersionTypeName = vsersionTypeName;
    }

    public int getServiceType() {
        return ServiceType;
    }

    public void setServiceType(int serviceType) {
        ServiceType = serviceType;
    }

    public String getServiceTypeName() {
        return ServiceTypeName;
    }

    public void setServiceTypeName(String serviceTypeName) {
        ServiceTypeName = serviceTypeName;
    }

    public boolean isbExpired() {
        return bExpired;
    }

    public void setbExpired(boolean bExpired) {
        this.bExpired = bExpired;
    }

    public double getExpiredYear() {
        return ExpiredYear;
    }

    public void setExpiredYear(double expiredYear) {
        ExpiredYear = expiredYear;
    }

    public String getExpiredStatus() {
        return ExpiredStatus;
    }

    public void setExpiredStatus(String expiredStatus) {
        ExpiredStatus = expiredStatus;
    }

    public long getUseId() {
        return UseId;
    }

    public void setUseId(long useId) {
        UseId = useId;
    }

    public String getUseName() {
        return UseName;
    }

    public void setUseName(String useName) {
        UseName = useName;
    }

    public String getHomeUrl() {
        return HomeUrl;
    }

    public void setHomeUrl(String homeUrl) {
        HomeUrl = homeUrl;
    }

    public int getPrice() {
        return Price;
    }

    public void setPrice(int price) {
        Price = price;
    }

    public String getExpireTime() {
        return ExpireTime;
    }

    public void setExpireTime(String expireTime) {
        ExpireTime = expireTime;
    }

    public boolean isBuy() {
        return IsBuy;
    }

    public int getSurplusData() {
        return SurplusData;
    }

    public void setSurplusData(int surplusData) {
        SurplusData = surplusData;
    }

    public int getOntrialCount() {
        return OntrialCount;
    }

    public void setOntrialCount(int ontrialCount) {
        OntrialCount = ontrialCount;
    }

    public int getIsShow() {
        return IsShow;
    }

    public void setIsShow(int isShow) {
        IsShow = isShow;
    }

    public String getLogoUrl() {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl) {
        this.logoUrl = logoUrl;
    }

    public boolean isVip() {
        return IsVip;
    }

    public void setVip(boolean vip) {
        IsVip = vip;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }

    @Override
    public boolean equals(Object o) {
        ServiceDetail serviceDetail = (ServiceDetail) o;
        return getServiceType() == serviceDetail.getServiceType();
    }

    /**
     * 服务版本常量类
     */
    public static class VersionType {

        /**
         * 服务版本:个人版
         */
        public static final int VERSION_TYPE_PERSONAL = 1;

        /**
         * 服务版本:班级版
         */
        public static final int VERSION_TYPE_CLASS = 2;

        /**
         * 服务版本:校园版
         */
        public static final int VERSION_TYPE_SCHOOL = 3;
    }
}
